From: Marco Trevisan (TreviƱo) Date: Thu, 8 Jun 2017 12:22:27 +0000 (+0200) Subject: shell-util: Apply resource_scale on clipping when getting the meta texture image X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~888^2^2~50 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6f027ee7dc8032895d29b6d4fd569597b19f38b8;p=gnome-shell.git shell-util: Apply resource_scale on clipping when getting the meta texture image https://bugzilla.gnome.org/show_bug.cgi?id=765011 https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5 --- diff --git a/src/shell-util.c b/src/shell-util.c index 88a9ce11e..31bb18e70 100644 --- a/src/shell-util.c +++ b/src/shell-util.c @@ -3,6 +3,7 @@ #include "config.h" #include +#include #include #include #include @@ -434,14 +435,23 @@ shell_util_get_content_for_window_actor (MetaWindowActor *window_actor, cairo_surface_t *surface; cairo_rectangle_int_t clip; gfloat actor_x, actor_y; + gfloat resource_scale; texture = meta_window_actor_get_texture (window_actor); clutter_actor_get_position (CLUTTER_ACTOR (window_actor), &actor_x, &actor_y); + if (!clutter_actor_get_resource_scale (CLUTTER_ACTOR (window_actor), + &resource_scale)) + { + resource_scale = 1.0; + g_warning ("Actor resource scale is not know at this point, " + "falling back to default 1.0"); + } + clip.x = window_rect->x - (gint) actor_x; clip.y = window_rect->y - (gint) actor_y; - clip.width = window_rect->width; - clip.height = window_rect->height; + clip.width = ceilf (window_rect->width * resource_scale); + clip.height = ceilf (window_rect->height * resource_scale); surface = meta_shaped_texture_get_image (META_SHAPED_TEXTURE (texture), &clip);